<template>
	<view>
		<view class="head">
			<view class="headBox">
				<image class="photo" :src="photo"></image>
				<text class="name">{{name}}</text>
			</view>
			<view class="content">
				{{content}}
			</view>
			<view class="fotter">
				<text class="particularYear">{{year}}</text>
			</view>
		</view>
		<view class="allReply">
			全部回复({{allreplyNum}})
		</view>
		<view class="headb" v-for="(item,index) in commentlistData" :key="index">
			<view class="headBox">
				<image class="photo" :src="item.member_avatar"></image>
				<text class="name">{{item.member_name}}</text>
			</view>
			<view class="content">
				{{item.reply_content}}
			</view>
			<view class="fotter">
				<text class="particularYear">{{item.create_time}}</text>
				<view class="plBox">
					<image class="infoimg" src="../../../static/prodtct/kefu.png" mode=""></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import Require from '../../../common/require.js';
	export default {
		data() {
			return {
				id:'',
				photo: '',
				name: '',
				content: '',
				year: '',
				allreplyNum: '',
				commentlistData: []
			}
		},
		onLoad(option) {
			var self =this
			self.id=option.id
			self.photo=option.photo
			self.name=option.name
			self.content=option.content
			self.year=option.year
		},
		onShow() {
			this.replyinfo();
		},
		methods:{
			replyinfo(){
				var self=this
				Require.commonRequest({
					url:'/api/forum/replylist',
					data:{
						commentid:self.id,
						page:10,
						pagesize:10,
					},
					method:'POST',
					success: function(ret) {
						  if(ret.data.code==200){
							  self.commentlistData=ret.data.data.replylist
							  self.allreplyNum=ret.data.data.replylist.length
							  }
						},
						fail: function() {
							uni.showToast({
								icon: "none",
								title: "网络异常，请稍后再试"
							})
						}
					})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #F1F1F1;
	}

	.head {
		width: 690rpx;
		background: rgba(255, 255, 255, 1);
		border-radius: 20rpx;
		margin-top: 20rpx;
		margin-left: 30rpx;
	}

	.headb {
		width: 690rpx;
		background: rgba(255, 255, 255, 1);
		border-radius: 20rpx;
		margin-bottom: 20rpx;
		margin-left: 30rpx;
	}

	.headBox {
		width: 690rpx;
		height: 120rpx;
		display: flex;
		align-items: center;
	}

	.photo {
		width: 64rpx;
		height: 64rpx;
		border-radius: 50%;
		margin-left: 30rpx;
	}

	.name {
		font-size: 28rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: rgba(46, 46, 46, 1);
		margin-left: 22rpx;
	}

	.content {
		width: 628rpx;
		font-size: 28rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: rgba(68, 68, 68, 1);
		line-height: 38rpx;
		margin-left: 30rpx;
	}

	.fotter {
		width: 690rpx;
		height: 66rpx;
		display: flex;
		align-items: center;
		position: relative;
	}

	.particularYear {
		font-size: 28rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: rgba(142, 142, 142, 1);
		margin-left: 30rpx;
	}

	.plBox {
		position: absolute;
		right: 30rpx;
	}

	.infoimg {
		width: 26rpx;
		height: 26rpx;
	}

	.allReply {
		width: 690rpx;
		height: 90rpx;
		margin-left: 30rpx;
		display: flex;
		align-items: center;
		font-size: 28rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: rgba(46, 46, 46, 1);
	}
</style>
